package com.qdu.servlet;

import com.qdu.entity.Log;
import com.qdu.service.impl.LogServiceImpl;
import java.io.IOException;
import java.util.List;
import javax.servlet.Servlet;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 *
 * @author Lenovo
 */
@WebServlet("/polfm")
public class PublishOneLogFromMain extends HttpServlet{

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {

        //获取请求参数
        String id=req.getParameter("id");
        
         //执行业务逻辑
        LogServiceImpl logserviceimpl=new LogServiceImpl();
        Log log=logserviceimpl.getOneLogById(id);//获取对应地日志并且请求转发
        List<Log> list=logserviceimpl.getAllLog();
        req.setAttribute("log", log);
        req.setAttribute("list",list);
        
        //生成动态响应
        req.getRequestDispatcher("publishLog.jsp").forward(req, resp);       
    }

  
        
    
    
    
}
